library(oneiric)
library(ggplot2)
library(RColorBrewer)
set.seed(288)
data(oneiric)
str(map_params)
## num [1:36, 1:6] -1.452 -0.983 1.536 -0.91 2.613 ...
## - attr(*, "dimnames")=List of 2
## ..$ : NULL
## ..$ : chr [1:6] "a" "b" "c" "d" ...
sim_ter <- system.file("extdata", package = "oneiric")
circles <- simulate_spatial(n_cells = 6000,
n_territories = 5,
n_samples = 12,
pattern = "circle",
max_expanse = 0.3)
rods <- simulate_spatial(n_cells = 6000,
n_territories = 5,
n_samples = 12,
pattern = "rod",
max_width = 0.1,
max_length = 0.5)
chaos <- simulate_spatial(n_cells = 6000,
n_samples = 12,
pattern = "chaos",
max_expanse = 0.02)
circles <- do.call("rbind", circles)
circles$Territory <- as.factor(circles$Territory)
g <- ggplot(circles, aes(x = x, y = y, col = Territory)) +
geom_point(size = 0.5) +
theme_bw() +
scale_color_brewer(palette="Spectral") +
facet_wrap(~sample) +
guides(colour = guide_legend(
override.aes = list(size = 5)))
print(g)
Circular Territories
rods <- do.call("rbind", rods)
rods$Territory <- as.factor(rods$Territory)
g <- ggplot(rods, aes(x = x, y = y, col = Territory)) +
geom_point(size = 0.5) +
theme_bw() +
scale_color_brewer(palette="Spectral") +
facet_wrap(~sample)+
guides(colour = guide_legend(
override.aes = list(size = 5)))
print(g)
Rod Territories
chaos <- do.call("rbind", chaos)
chaos$Territory <- as.factor(chaos$Territory)
g <- ggplot(chaos, aes(x = x, y = y, col = Territory)) +
geom_point(size = 0.5) +
theme_bw() +
scale_color_brewer(palette="Spectral") +
facet_wrap(~sample)+
guides(colour = guide_legend(
override.aes = list(size = 5)))
print(g)
Tinkerbell Map Territories